<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('接口管理列表')" />
    <th:block th:include="include :: datetimepicker-css" />
</head>
<body class="gray-bg">
<div class="container-div">
    <div class="row">
        <div class="col-sm-12 search-collapse">
            <form id="formId">
                <div class="select-list">
                    <ul>
                        <li>
                            <label>月份：</label>
                            <input id="dimMonth" name="mm" th:value="${month}" autocomplete="off" onchange="$.table.search()" placeholder="yyyy-MM" type="text">
                        </li>
                        <li>
                            <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                            <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                        </li>
                    </ul>
                </div>
            </form>
        </div>
        <div class="col-sm-12 select-table table-striped">
            <table id="bootstrap-table"></table>
        </div>
    </div>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" />
<script th:inline="javascript">
    var prefix = ctx + "base/etl/check";
    var dbData = [[${@baseDbService.selectAll()}]];
    function showDetail(mm) {
        if(mm.length==7) {
            $.modal.openTab("核对详情",ctx+"base/etl/check?mm="+mm);
        } else if(mm.length==10){
            $.modal.openTab("核对详情",ctx+"base/etl/check/day?day="+mm);
        }
    }
    $(function() {
        var now = new Date();
        $("#dimMonth").datetimepicker({
            format: "yyyy-mm",
            startView: 3,
            minView: 3,
            maxDate: now.getFullYear() + "-" + (now.getMonth()),
            autoclose: true
        });
        var options = {
            url: prefix + "/byMonth",
            modalName: "接口管理",
            columns: [{
                checkbox: true
            },
                {
                    field: 'idDataCheck',
                    title: '主键'
                },
                {
                    field: 'mm',
                    title: '日期'
                },
                {
                    field: 'score',
                    title: '总分'
                },
                {
                    field: 'scoreOds',
                    title: '贴源层得分'
                },
                {
                    field: 'scoreDw',
                    title: '数仓得分'
                },
                {
                    field: 'scoreDm',
                    title: '集市得分'
                },
                {
                    field: 'dtSysCre',
                    title: '创建时间'
                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function(value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-success btn-xs " href="javascript:void(0)" onclick="showDetail(\'' + row.mm+ '\')"><i class="fa fa-edit"></i>明细</a> ');
                        return actions.join('');
                    }
                }]
        };
        $.table.init(options);
    });
    function preview(outerId) {
        var url = prefix + '/preview/' + outerId;
        $.modal.openTab("接口数据预览", url);
    }
</script>
</body>
</html>